package com.yvon.maple.service.system.bo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.yvon.boot.excel.annotation.ExcelDictFormat;
import com.yvon.boot.excel.annotation.LocalDateTimeFormat;
import com.yvon.boot.excel.converter.ExcelBigNumberConvert;
import com.yvon.boot.excel.converter.ExcelDictConvert;
import com.yvon.boot.excel.converter.LocalDateTimeExcelConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class LogBo implements Serializable {

	/**
	 * id
	 */
	@ExcelProperty(value = "ID", converter = ExcelBigNumberConvert.class)
	private Long id;

	/**
	 * 创建时间
	 */
	@ExcelProperty(value = "创建时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime createTime;

	/**
	 * 更新时间
	 */
	@ExcelProperty(value = "更新时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime updateTime;

	/**
	 * 跟踪ID
	 */
	@ExcelProperty(value = "跟踪ID")
	private String traceId;

	/**
	 * 类型
	 */
	@ExcelProperty(value = "类型", converter = ExcelDictConvert.class)
	@ExcelDictFormat(readConverterExp = "success=成功,error=失败")
	private String type;

	/**
	 * 标题
	 */
	@ExcelProperty(value = "标题")
	private String title;

	/**
	 * 操作
	 */
	@ExcelProperty(value = "操作")
	private String operation;

	/**
	 * http方法
	 */
	@ExcelProperty(value = "http方法")
	private String httpMethod;

	/**
	 * url
	 */
	@ExcelProperty(value = "url")
	private String url;

	/**
	 * 类路径
	 */
	@ExcelProperty(value = "类路径")
	private String classPath;

	/**
	 * 参数
	 */
	@ExcelProperty(value = "参数")
	private String param;

	/**
	 * ip地址
	 */
	@ExcelProperty(value = "ip地址")
	private String ip;

	/**
	 * 位置
	 */
	@ExcelProperty(value = "位置")
	private String location;

	/**
	 * 用户名
	 */
	@ExcelProperty(value = "用户名")
	private String username;


	/**
	 * 异常
	 */
	@ExcelProperty(value = "异常")
	private String exception;

	/**
	 * 开始时间
	 */
	@ExcelProperty(value = "开始时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime startTime;

	/**
	 * 完成时间
	 */
	@ExcelProperty(value = "完成时间", converter = LocalDateTimeExcelConverter.class)
	@LocalDateTimeFormat("yyyy年MM月dd日 HH时mm分ss秒")
	private LocalDateTime finishTime;

	/**
	 * 消耗时间
	 */
	@ExcelProperty(value = "消耗时间")
	private Long consumingTime;
}
